package com.zero.controller;

import com.zero.entity.Email;
import com.zero.entity.Web;
import com.zero.service.EmailService;
import com.zero.service.WebService;
import com.zero.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/web")
public class WebController {

    @Autowired
    private WebService webService;

    @Autowired
    private EmailService emailService;

    @GetMapping("/info")
    public Result getWebInfo(){
        return webService.getWebInfo();
    }

    @GetMapping("/recentEmail")
    public Result getRecentEmail(){
        return emailService.getRecentEmail();
    }

    @PostMapping("/updateWebInfo")
    public Result updateWebInfo(@RequestBody Web web){
        return webService.updateWebInfo(web);
    }

}
